import {stringify} from "qs";
import * as apiTask from "./apiTask"; //任务管理
import * as apiPersonnelRecruitment from "./apiPersonnelRecruitment"; //人事招聘
import * as apiBusinessAddressBook from "./apiBusinessAddressBook"; //企业通讯录
import {
  request,
  loginRequest,
  noLoginRequest,
  getHostByPath
} from "../utils/request";
import * as api_kaoQinGuanLi from "./api_kaoQinGuanLi"; //考勤管理
import * as api_taskbuild from "./api_taskbuild"; //考勤管理
import * as api_brachCompany from "./api_brachCompany"; //考勤管理
import config from "../utils/config";
// import * as requestUtil from "../utils/request.js";

//考勤管理
export const {
  attendanceGetShiftPage,
  attendanceDeleteShiftById,
  taskAttendanceComAttendGroupAddAttendGroup,
  taskAttendanceComAttendGroupFindAttendGroupById,
  taskAttendanceComAttendGroupUpdateAttendGroup,
  taskAttendanceComAttendGroupFindAttendGroupByPerId,
  taskAttendanceComAttendGroupPageForGroup,
  taskAttendanceComAttendGroupDelete,
  taskComShiftPage,
  taskAttendanceComAttendGroupFindAttendGroupByPerIdStr,
  taskAttendanceComattendgroupfixedSave,
  taskAttendanceComattendgroupfixedGetAddTemp,
  taskAttendanceComattendgroupfixedUpdate,
  taskAttendanceComattendgroupfixedGetDetail,
  taskAttendanceComAttendGroupListAttendGroupAddress,
  taskAttendanceComAttendGroupUpdateAttendGroupAddress,
  taskAttendanceComAttendGroupAddAttendGroupAddress,
  taskComShiftDelete,
  taskComShiftGet,
  taskComShiftInsert,
  taskComShiftUpdate,
  taskAttendanceComAttendGroupInFirstStepAttendGroup,
  taskAttendanceComAttendGroupSaveFirstStepAttendGroup,
  taskAttendanceComAttendGroupInSecondStepAttendGroup,
  taskAttendanceComAttendGroupSaveSecondStepAttendGroup,
  taskAttendanceComAttendGroupInThirdStepAttendGroup,
  taskAttendanceComAttendGroupSaveThirdStepAttendGroup,
  taskAttendanceComAttendGroupCheckAttendPer
} = api_kaoQinGuanLi;

/* 本地开发环境  */
let host = config.dailyhost;

/* 测试环境*/
if (window.location.port === "8005") {
  host = config.testhost;
}
// /* 开发环境  */
// if (window.location.port === "8000") {
//   host = "http://192.168.30.150:8094";
// }
/* 登录 */
export function accesstoken(data) {
  const url = `/system/oauth/web/accesstoken?grant_type=password&client_secret=web&client_id=saasweb&username=${
    data.username
    }&password=${data.password}&redirect_uri=${data["redirect_uri"]}`;
  return loginRequest(url, {});
}

export const {
  taskBaseInfo,
  taskManagementAddTaskStepOne,
  taskComTaskPerShiftListShift,
  taskComTaskPerShiftListPerShift,
  taskComTaskPerShiftValidateSinglePerShift,
  taskComTaskPerShiftSetSinglePerShift,
  taskComTaskPerShiftResetSinglePerShift,
  taskAttendanceAndTrackAttendanceRecord,
  taskAttendanceAndTrackTaskLog,
  taskComTaskImplAttendanceStatus,
  taskComTaskImplQueryTrack,
  taskComTaskPerShiftPagePerShift,

  taskTrackSelectImplementMonth,
  taskTrackListImplement,
} = apiTask;

//人事招聘
export const {
  enterprisePerResumePage,
  enterprisePerResumeResumeDetails,
  enterpriseResumeCollectPage,
  enterprisePerResumeForSearchPage,
  enterpriseSaveResumeFromSearchPage,
  enterpriseComJobPage,
  enterpriseDeleteComJob,
  enterpriseUpdateReleaseStatusComJob,
  enterpriseUpdateReleaseTimeComJob,
  enterpriseUpdateComJob,
  enterpriseSaveComJob,
  enterpriseGetComJob,
  enterprisePerSendResumeRemark,
  enterprisePerSendGetRemark,
  enterpriseResumeCollectChangeRemark,
  enterpriseResumeCollectGetRemark,
  enterpriseResumeCollectResumeDetails,
  enterpriseResumeCollectDelete,
  enterpriseGetPositionType
} = apiPersonnelRecruitment;

//企业通讯录
export const {
  enterpriseRoleUpdate,
  enterpriseRoleSave,
  enterpriseRoleGet,
  enterpriseRoleDeleteById,
  searchRoleGroup,
  systemComRoleInsertPerRole,
  searchRoleAndRoleGroupList,
  searchPerSonByRoleId,
  enterpriseRoleGroupSave,
  enterpriseRoleGroupDelete,
  searchRoleListBykeyword,
  batchesDelete,
  enterpriseRoleGroupGet,
  systemComDepartList,
  systemPerCerBaseInfoFindAll,
  systemConfigPerCerInfoFindListByPercertype,
  systemPerCerBaseInfoSave,
  systemComDepartPage,
  systemComDepartUpdate,
  systemComDepartTreeComDepart,
  systemComDepartGet,
  systemPerCerBaseInfoDelete,
  systemPerCerBaseInfoFind,
  systemPerCerBaseInfoUpdate,
  systemPerBaseInfoGetInfoByPhone,
  systemPlatNewsSendActivationMessage,
  systemComDepartUpdateLeaveDate,
  enterpriseLeaveList,
  systemPerCerBaseInfoGet,
  searchOnlyGroup,
  systemComDepartAdjustDepart,
  systemPerBaseInfoUpdateBaseInfo,
  systemPerBaseInfoSaveBaseInfo,
  systemPerBaseInfoVerificationPhone,
  systemPerBaseInfoGetPerBaseInfo,
  systemConfigPerIndustryFindListByComId,
  systemPerBaseInfoUpdateDetailedInfo,
  systemComDepartExportDepart,
  systemComDepartGetTreeDepart,
  systemComRoleGroupList,
  systemComRoleFindAllRole,
  enterpriseRoleGroupUpdate
} = apiBusinessAddressBook;

export {host};

export async function queryProjectNotice() {
  return request("/api/project/notice");
}

export async function queryActivities() {
  return request("/api/activities");
}

export async function queryRule(params) {
  return request(`/api/rule?${stringify(params)}`);
}

export async function removeRule(params) {
  return request("/api/rule", {
    method: "POST",
    body: {
      ...params,
      method: "delete"
    }
  });
}

export async function addRule(params) {
  return request("/api/rule", {
    method: "POST",
    body: {
      ...params,
      method: "post"
    }
  });
}

export async function fakeSubmitForm(params) {
  return request("/api/forms", {
    method: "POST",
    body: params
  });
}

export async function fakeChartData() {
  return request("/api/fake_chart_data");
}

export function fakeChartData1() {
  return request("/api/fake_chart_data");
}

export async function queryTags() {
  return request("/api/tags");
}

export async function queryBasicProfile() {
  return request("/api/profile/basic");
}

export async function queryAdvancedProfile() {
  return request("/api/profile/advanced");
}

export async function queryFakeList(params) {
  return request(`/api/fake_list?${stringify(params)}`);
}

export async function fakeAccountLogin(params) {
  return request("/api/login/account", {
    method: "POST",
    body: params
  });
}

export async function fakeMobileLogin(params) {
  return request("/api/login/mobile", {
    method: "POST",
    body: params
  });
}

export async function fakeRegister(params) {
  return request("/api/register", {
    method: "POST",
    body: params
  });
}

export async function queryNotices() {
  return request("/public/message/unread-message-list", {
    method: "POST",
    data: {}
  });
}

// 通过ID获得企业基本信息
export function getComBaseInfoById(data) {
  return request("/enterprise/company/com-base-info/get-com-base-info-by-id", {
    method: "POST",
    data
  });
}

// 获取用户登陆菜单
export function systemOauthGetUserMenus(data) {
  return request("/system/oauth/get-user-menus", {
    method: "GET",
    data
  });
}

// 修改企业基本信息
export function updateComBaseInfoById(data) {
  return request("/enterprise/company/com-base-info/update-com-base-info", {
    method: "POST",
    data
  });
}

// 公共信息
export function getDictInformation(data) {
  return noLoginRequest("/public/common/dict/get-dict-by-code-types", {
    method: "POST",
    data
  });
}

// 得到保障项目信息
export function getInsProjects(data) {
  return noLoginRequest("/public/common/dict/get-ins-projects", {
    method: "POST",
    data
  });
}

// 获取企业详情
export function systemComVaseInfoGet(data) {
  return request("/system/com-base-info/get", {
    method: "GET",
    data
  });
}

// 企业信息-认证申请查询
export function getCertificationData(data) {
  return request("/enterprise/company/com-auth-info/get-com-auth-info-by-id", {
    method: "POST",
    data
  });
}

// 企业信息-认证申请-行业资质查询
export function enterpriseCompanyGetComIndustryinfo(data) {
  return request(
    "/enterprise/company/com-auth-info/get-com-industry-info-by-comid",
    {
      method: "POST",
      data
    }
  );
}

//通过ID获得企业状态
export function getComStatusAll(data) {
  return request("/enterprise/company/com-base-info/get-com-status-all", {
    method: "POST",
    data
  });
}

//省市区
export function getDistrictData() {
  return noLoginRequest("/public/common/region/get-regions", {
    method: "POST",
    data: {}
  });
}

//省市区的代码换算中文
export function getDistrictChineseData(data) {
  return noLoginRequest("/public/common/region/get-region-by-id", {
    method: "POST",
    data
  });
}

//修改企业认证信息
export function enterpriseCompanyUpdateComAuthInfo(data) {
  return request("/enterprise/company/com-auth-info/update-com-auth-info", {
    method: "POST",
    data
  });
}

export function modifyComInformation(data) {
  return request("/enterprise/company/update-com-auth-info", {
    method: "POST",
    data
  });
}

//手机验证===发送法人手机验证码
export function enterpriseCompanySendLegalAuthCode(data) {
  return request("/enterprise/company/com-auth-info/send-legal-auth-code", {
    method: "POST",
    data
  });
}

// 获得企业报表列表
export function enterpriseSalaryComReportCompanyReportList(data) {
  return request("/enterprise/salary/com-report/company-report-list", {
    method: "POST",
    data
  });
}

//手机验证===验证验证码，检查手机验证码和企业ID是否匹配，10分钟后验证码过期
export function enterpriseComAuthInfoCheckLegalAuthCode(data) {
  return request("/enterprise/company/com-auth-info/check-legal-auth-code", {
    method: "POST",
    data
  });
}

//根据企业ID获得企业发票信息
export function getCompanyVnvoiceInfo(data) {
  return request("/enterprise/company/com-invoice/get-company-invoice-info", {
    method: "POST",
    data
  });
}

//保存企业发票信息
export function saveCompanyInvoiceInfo(data) {
  return request("/enterprise/company/com-invoice/save-company-invoice-info", {
    method: "POST",
    data
  });
}

//修改企业发票信息
export function updateCompanyInvoiceInfo(data) {
  return request(
    "/enterprise/company/com-invoice/update-company-invoice-info",
    {
      method: "POST",
      data
    }
  );
}

//文件上传服务
export const uploadUrl =
  getHostByPath("/public") + "/public/common/file/upload-file";

//文件读取服务
export function publicCommonFileGetResource(data) {
  return noLoginRequest("/public/common/file/get-resource", {
    method: "GET",
    data
  });
}

//文件预览转换
export function publicCommonFileFilePreview(data) {
  return noLoginRequest("/public/common/file/filePreview", {
    method: "POST",
    data
  });
}

// 查询数据字典接口
export function publicCommonDictGetDictByCodeTypes(data) {
  return noLoginRequest("/public/common/dict/get-dict-by-code-types", {
    method: "POST",
    data
  });
}

// 删除报表
export function enterpriseSalaryComReportDeleteCompanyReport(data) {
  return request("/enterprise/salary/com-report/delete-company-report", {
    method: "POST",
    data
  });
}

// 获取报表表头字段集合
export function enterpriseSalaryComReportReportFieldList(data) {
  return request("/enterprise/salary/com-report/report-field-list", {
    method: "POST",
    data
  });
}

// 新建企业自定义报表
export function enterpriseSalaryComReportAddCompanyReport(data) {
  return request("/enterprise/salary/com-report/add-company-report", {
    method: "POST",
    data
  });
}

//医社保记录统计
export function statHisRecList(data) {
  return request("/enterprise/ins/medical-social-rec/stat-his-rec-list", {
    method: "POST",
    data
  });
}

//提示用户去完成方案的设置
export function promptUserToSetScheme(data) {
  return request(
    "/enterprise/ins/medical-social-rec/prompt-user-to-set-scheme",
    {
      method: "GET",
      data
    }
  );
}

//医社保记录，导出excel
export function exportHisRecList(data) {
  return request("/enterprise/ins/medical-social-rec/export-his-rec-list", {
    method: "GET",
    data
  });
}

//医社保记录，查询人员缴交情况分页
export function getHisRecListPage(data) {
  return request("/enterprise/ins/medical-social-rec/get-his-rec-list-page", {
    method: "POST",
    data
  });
}

//缴交设置列表，查询人员缴交情况分页
export function getPaymentSettingListPage(data) {
  return request(
    "/enterprise/ins/payment-setting-list/get-payment-setting-list-page",
    {
      method: "POST",
      data
    }
  );
}

//删除缴交方案
export function delPaymentSetting(data) {
  return request("/enterprise/ins/payment-setting-list/del-payment-setting", {
    method: "POST",
    data
  });
}

//缴交方案详情查询，通过缴交方案ID
export function getPaymentSettingById(data) {
  return request("/enterprise/ins/payment-setting/get-payment-setting-by-id", {
    method: "POST",
    data
  });
}

//缴交方案的已选人员列表
export function getSelectedPersonPage(data) {
  return request("/enterprise/ins/payment-setting/get-selected-person-page", {
    method: "POST",
    data
  });
}

//移除人员，删除关系数据
export function paymentSettingDelPerson(data) {
  return request("/enterprise/ins/payment-setting/del-person", {
    method: "POST",
    data
  });
}

//添加人员，增加关系数据
export function paymentSettingAddPerson(data) {
  return request("/enterprise/ins/payment-setting/add-person", {
    method: "POST",
    data
  });
}

//缴交方案新增或修改
export function paymentSettingSavePaymentSetting(data) {
  return request("/enterprise/ins/payment-setting/save-payment-setting", {
    method: "POST",
    data
  });
}

//分页消息列表（收件人方）
export function messageReceiveList(data) {
  return request("/public/message/page-message-list", {
    method: "POST",
    data
  });
}

//当前用户-批量删除消息
export function messageDeleteSelectMessage(data) {
  return request("/public/message/batch-delete", {
    method: "POST",
    data
  });
}

//根据消息关联id删除消息
export function messageDeleteMessageById(data) {
  return request("/public/message/batch-delete", {
    method: "POST",
    data
  });
}

//当前用户-批量修改消息-设置为已读
export function updateSelectMessageRead(data) {
  return request("/public/message/batch-set-read", {
    method: "POST",
    data
  });
}

//根据消息关联id查询具体消息详情
export function messagegetmessagebyid(data) {
  return request("/public/message/message-detail", {
    method: "POST",
    data
  });
}

//保存消息-企业消息------改成罗鹏的接口
export function messageSaveMessageCommon(data) {
  return request("/public/message/save-message", {
    method: "POST",
    data
  });
}

//当前用户获取消息记录列表
export function messageRecordList(data) {
  return request("/public/message/page-send-message-list", {
    method: "POST",
    data
  });
}

//企业保险查询分页
export function comInsGetComInsPage(data) {
  return request("/enterprise/ins/com-ins/get-com-ins-page", {
    method: "POST",
    data
  });
}

//方案书分页查询
export function enterpriseInsComInsGetInsBootPage(data) {
  return request("/enterprise/ins/com-ins/get-ins-boot-page", {
    method: "POST",
    data
  });
}

//保全链接生成
export async function enterpriseInsComInsGetOnlineInsBlbPreservationLink(data) {
  return request(
    "/enterprise/ins/com-ins/get-online-ins-blb-preservation-link",
    {
      method: "POST",
      async: false,
      data
    }
  );
}

//获取在线保险链接
export function getOnlineInsBlbLink(data) {
  return request("/enterprise/ins/com-ins/get-online-ins-blb-link", {
    method: "POST",
    data
  });
}

//获取在线保险链接
export function getOnlineInsBlbDetailLink(data) {
  return request("/enterprise/ins/com-ins/get-online-ins-blb-detail-link", {
    method: "POST",
    data
  });
}

//删除企业保险
export function comInsDeleteComInsUnderline(data) {
  return request("/enterprise/ins/com-ins/delete-com-ins-underline", {
    method: "POST",
    data
  });
}

//企业保险详情
export function comInsGetComInsDetail(data) {
  return request("/enterprise/ins/com-ins/get-com-ins-detail", {
    method: "POST",
    data
  });
}

//新增企业保险
export function comInsInsertComInsUnderline(data) {
  return request("/enterprise/ins/com-ins/insert-com-ins-underline", {
    method: "POST",
    data
  });
}

// ----------------------------------股东----------------------------------
// 获取公司所有股东
export function getCompanyShareHolder(data) {
  return request("/enterprise/stock/com-stock/holder-list", {
    method: "POST",
    data
  });
}

//获得公司所有股东（基本信息）
export function comStockBasicHolderList(data) {
  return request("/enterprise/stock/com-stock/basic-holder-list", {
    method: "POST",
    data
  });
}

//获取公司有股权的股东
export function getCompanyValidShare(data) {
  return request("/enterprise/stock/com-stock/list-validshare", {
    method: "POST",
    data
  });
}

//删除股东
export function deleteShareholder(data) {
  return request("/enterprise/stock/com-stock/delete-shareholder", {
    method: "POST",
    data
  });
}

//新增机构股东
export function saveOrgShareholder(data) {
  return request("/enterprise/stock/com-stock/add-org-shareholder", {
    method: "POST",
    data
  });
}

//新增自然人股东
export function savePerShareholder(data) {
  return request("/enterprise/stock/com-stock/add-per-shareholder", {
    method: "POST",
    data
  });
}

//获得股东变更事件列表
export function getHolderChangeList(data) {
  return request("/enterprise/stock/com-stock/change-list", {
    method: "POST",
    data
  });
}

//获取单个股东信息
export function comStockGetShareholderById(data) {
  return request("/enterprise/stock/com-stock/get-shareholder-by-id", {
    method: "POST",
    data
  });
}

//获得股东事件变更记录
export function getChangeDetail(data) {
  return request("/enterprise/stock/com-stock/change-detail", {
    method: "POST",
    data
  });
}

//股权变更（预览校验）
export function comStockChangeSharePreview(data) {
  return request("/enterprise/stock/com-stock/change-share-preview", {
    method: "POST",
    data
  });
}

//股权变更（保存）
export function saveComStockChangeShare(data) {
  return request("/enterprise/stock/com-stock/change-share", {
    method: "POST",
    data
  });
}

//股权初始化
export function comStockInitShare(data) {
  return request("/enterprise/stock/com-stock/init-share", {
    method: "POST",
    data
  });
}

//获得公司所有股权信息
export function comStockListValidsharebasic(data) {
  return request("/enterprise/stock/com-stock/list-validsharebasic", {
    method: "POST",
    data
  });
}

//获取当前登陆用户账号信息
export function systemPerAccountInfoGetUserAccount(data) {
  return request("/system/per-account-info/get-user-account", {
    method: "GET",
    data
  });
}

//------------------------股东end------------------ 获取跨区经营列表
export function comStockCrossManageList(data) {
  return request("/enterprise/stock/submit/com-stock/cross-manage-list", {
    method: "POST",
    data
  });
}

//根据ID删除跨区经营信息
export function comStockDeleteCrossManageById(data) {
  return request(
    "/enterprise/stock/submit/com-stock/delete-cross-manage-by-id",
    {
      method: "POST",
      data
    }
  );
}

//根据ID获取跨区经营信息
export function comStockGetCrossManageById(data) {
  return request("/enterprise/stock/submit/com-stock/get-cross-manage-by-id", {
    method: "POST",
    data
  });
}

//保存-修改跨区经营
export function comStockSaveCrossManage(data) {
  return request("/enterprise/stock/submit/com-stock/save-cross-manage", {
    method: "POST",
    data
  });
}

//获取海外经营列表
export function comStockComOverseaManageList(data) {
  return request("/enterprise/stock/submit/com-stock/com-oversea-manage-list", {
    method: "POST",
    data
  });
}

//根据ID删除海外经营信息
export function comStockDeleteOverseaManageById(data) {
  return request(
    "/enterprise/stock/submit/com-stock/delete-oversea-manage-by-id",
    {
      method: "POST",
      data
    }
  );
}

//获取海外经营信息
export function comStockGetOverseaManageById(data) {
  return request(
    "/enterprise/stock/submit/com-stock/get-oversea-manage-by-id",
    {
      method: "POST",
      data
    }
  );
}

//保存-修改海外经营
export function stockSubmitComStockSaveOverseaManage(data) {
  return request("/enterprise/stock/submit/com-stock/save-oversea-manage", {
    method: "POST",
    data
  });
}

//保存-修改管理层
export function submitComStockSaveComManage(data) {
  return request("/enterprise/stock/submit/com-stock/save-com-manage", {
    method: "POST",
    data
  });
}

//获取管理员列表-liyongqiang
export function comStockManageList(data) {
  return request("/enterprise/stock/submit/com-stock/com-manage-list", {
    method: "POST",
    data
  });
}

//根据id删除管理员信息-liyongqiang
export function comStockDeleteManageById(data) {
  return request("/enterprise/stock/submit/com-stock/delete-com-manage-by-id", {
    method: "POST",
    data
  });
}

//获取管理员信息-liyongqinag
export function comStockGetManageById(data) {
  return request("/enterprise/stock/submit/com-stock/get-com-manage-by-id", {
    method: "POST",
    data
  });
}

//获取管理层变更信息列表-liyongqiang
export function comStockChangeManageList(data) {
  return request("/enterprise/stock/submit/com-stock/change-manage-list", {
    method: "POST",
    data
  });
}

//获取在职管理员的列表（人员选择下拉列表）
export function comStockComManageListByStatus(data) {
  return request(
    "/enterprise/stock/submit/com-stock/com-manage-list-by-status",
    {
      method: "POST",
      data
    }
  );
}

//替换-新管理员代替旧管理员
export function comStockSaveReplaceComManage(data) {
  return request("/enterprise/stock/submit/com-stock/save-replace-com-manage", {
    method: "POST",
    data
  });
}

//获取管理员信息
export function comStockGetComManageById(data) {
  return request("/enterprise/stock/submit/com-stock/get-com-manage-by-id", {
    method: "POST",
    data
  });
}

//获取主管理员信息
export function selectComAdmin(data) {
  return request("/system/per-account-info/select-com-admin", {
    method: "POST",
    data
  });
}

//更改主管理员
export function changeComAdmin(data) {
  return request("/system/com-admin-change-event/update", {
    method: "POST",
    data
  });
}

/**
 * 游客注册-联系手机验证
 * @author Orm
 */
export function systemPerAccountInfoVerificationPhone(data) {
  return noLoginRequest("/system/per-account-info/verification-phone", {
    method: "POST",
    data
  });
}

/**
 * 游客注册-获取手机验证码
 * @author Orm
 */
export function systemPlatNewsSendVerificationCode(data) {
  return noLoginRequest("/system/plat-news/send-verification-code", {
    method: "POST",
    data
  });
}

/**
 * 游客注册-验证短信验证码
 * @author Orm
 */
export function systemPlatNewsVerificationCode(data) {
  return noLoginRequest("/system/plat-news/verification-code", {
    method: "POST",
    data
  });
}

/**
 * 游客注册-个人用户注册
 * @author Orm
 */
export function systemPerAccountInfoSave(data) {
  return noLoginRequest("/system/per-account-info/save", {
    method: "POST",
    data
  });
}

/**********************************************企业设备******************************************/

/**
 * 设备列表-获取企业设备列
 * @author CXL
 */
export function enterpriseEquipComEquipListComEquip(data) {
  return request("/enterprise/equip/com-equip/list-com-equip", {
    method: "POST",
    data
  });
}

/**
 * 设备列表-获取企业设备详情
 * @author CXL
 */
export function enterpriseEquipComEquipGetComEquipById(data) {
  return request("/enterprise/equip/com-equip/get-com-equip-by-id", {
    method: "GET",
    data
  });
}

/**
 * 设备列表-新增企业设备
 * @author CXL
 */
export function enterpriseEquipComEquipAddComEquip(data) {
  return request("/enterprise/equip/com-equip/add-com-equip", {
    method: "POST",
    data
  });
}

/**
 * 设备列表-查询是否已经存在企业设备编号
 * @author CXL
 */
export function countComEquipNo(data) {
  return request("/enterprise/equip/com-equip/count-com-equipNo", {
    method: "GET",
    data
  });
}

/**
 * 设备列表-根据Id删除企业设备
 * @author CXL
 */
export function enterpriseEquipComEquipDeleteComEquipById(data) {
  return request("/enterprise/equip/com-equip/delete-com-equip-by-id", {
    method: "GET",
    data
  });
}

/**
 * 设备列表-修改企业设备
 * @author CXL
 */
export function enterpriseEquipComEquipUpdateComEquip(data) {
  return request("/enterprise/equip/com-equip/update-com-equip", {
    method: "POST",
    data
  });
}

/**********************************************企业设备出入库******************************************/

/**
 * 设备出入库-获取企业设备出入库记录列表
 * @author CXL
 */
export function enterpriseEquipComEquipInOutListComEquipInOut(data) {
  return request("/enterprise/equip/com-equip-in-out/list-com-equip-in-out", {
    method: "POST",
    data
  });
}

/**
 * 设备出入库-新增企业设备出入库记录
 * @author CXL
 */

export function enterpriseEquipComEquipInOutAddComEquipInOut(data) {
  return request("/enterprise/equip/com-equip-in-out/add-com-equip-in-out", {
    method: "POST",
    data
  });
}

export function EnterpriseEquipComEquipInOutGetComEquipInOutById(data) {
  return request(
    "/enterprise/equip/com-equip-in-out/get-com-equip-in-out-by-id",
    {
      method: "GET",
      data
    }
  );
}

//新增企业设备出入库记录
export function comEquipInOutAddComEquipInOut(data) {
  return request("/enterprise/equip/com-equip-in-out/add-com-equip-in-out", {
    method: "POST",
    data
  });
}

/**********************************************合同******************************************/

/**
 * 合同管理-获取合同列表
 * @author CXL
 */
export function enterpriseComContractComContractList(data) {
  return request("/enterprise/com-contract/com-contract-list", {
    method: "POST",
    data
  });
}

/**
 * 合同管理-删除合同
 * @author CXL
 */
export function enterpriseComContractDeleteComContract(data) {
  return request("/enterprise/com-contract/delete-com-contract", {
    method: "POST",
    data
  });
}

/**
 * 合同管理-终止合同
 * @author CXL
 */
export function enterpriseComContractTerminationComContract(data) {
  return request("/enterprise/com-contract/termination-com-contract", {
    method: "POST",
    data
  });
}

/**
 * 合同管理-通过ID获得合同信息
 * @author CXL
 */
export function enterpriseComContractGetComContractById(data) {
  return request("/enterprise/com-contract/get-com-contract-by-id", {
    method: "POST",
    data
  });
}

/**
 * 合同管理-合同初始化
 * @author CXL
 */
export function enterpriseComContractInitComContract(data) {
  return request("/enterprise/com-contract/init-com-contract", {
    method: "POST",
    data
  });
}

/**
 * 合同管理-新增合同
 * @author CXL
 */
export function enterpriseComContractInsertComContract(data) {
  return request("/enterprise/com-contract/insert-com-contract", {
    method: "POST",
    data
  });
}

/**
 * 合同管理-修改合同
 * @author CXL
 */
export function enterpriseComContractUpdateComContract(data) {
  return request("/enterprise/com-contract/update-com-contract", {
    method: "POST",
    data
  });
}

/**
 * 合同管理-校验合同名称唯一性
 * @author ZJH
 */
export function checkContractName(data) {
  return request("/enterprise/com-contract/check-contract-name", {
    method: "POST",
    data
  });
}

/**
 * 合同管理-校验企业档案编号名称唯一性
 * @author ZJH
 */
export function checkComFileNo(data) {
  return request("/check-com-file-no", {
    method: "POST",
    data
  });
}

/**********************************************好人好事******************************************/

/**
 * 好人好事-获取好人好事列表
 * @author ZJH
 */
export function listPerGoodDeeds(data) {
  return request(
    "/enterprise/awardPenalty/per-good-deeds/list-per-good-deeds",
    {
      method: "POST",
      data
    }
  );
}

/**
 * 好人好事-删除好人好事
 * @author ZJH
 */
export function deletePerGoodDeedsById(data) {
  return request(
    "/enterprise/awardPenalty/per-good-deeds/delete-per-good-deeds-by-id",
    {
      method: "GET",
      data
    }
  );
}

/**
 * 好人好事-好人好事详情
 * @author ZJH
 */
export function getPerGoodDeedsById(data) {
  return request(
    "/enterprise/awardPenalty/per-good-deeds/get-per-good-deeds-by-id",
    {
      method: "GET",
      data
    }
  );
}

/**
 * 好人好事-更新好人好事
 * @author ZJH
 */
export function updatePerGoodDeeds(data) {
  return request(
    "/enterprise/awardPenalty/per-good-deeds/update-per-good-deeds",
    {
      method: "POST",
      data
    }
  );
}

/**
 * 好人好事-新增好人好事
 * @author ZJH
 */
export function addPerGoodDeeds(data) {
  return request("/enterprise/awardPenalty/per-good-deeds/add-per-good-deeds", {
    method: "POST",
    data
  });
}

/**
 * 好人好事-查询人员身份证
 * @author ZJH
 */
export function selectPerIdCardNum(data) {
  return request(
    "/enterprise/awardPenalty/per-good-deeds/select-per-id-card-num",
    {
      method: "GET",
      data
    }
  );
}

/**********************************************奖励列表******************************************/
/**
 * 奖励列表-列表
 * @author ZJH
 */
export function listComSecurityAward(data) {
  return request(
    "/enterprise/awardPenalty/per-security-award/list-com-security-award",
    {
      method: "POST",
      data
    }
  );
}

/**
 * 奖励列表-新增保安人员奖励信息
 * @author ZJH
 */
export function addComSecurityAward(data) {
  return request(
    "/enterprise/awardPenalty/per-security-award/add-com-security-award",
    {
      method: "POST",
      data
    }
  );
}

/**
 * 奖励列表-保安人员奖励信息详情
 * @author ZJH
 */
export function getComSecurityAwardById(data) {
  return request(
    "/enterprise/awardPenalty/per-security-award/get-com-security-award-by-id",
    {
      method: "GET",
      data
    }
  );
}

/**
 * 奖励列表-修改保安人员奖励信息
 * @author ZJH
 */
export function updateComSecurityAward(data) {
  return request(
    "/enterprise/awardPenalty/per-security-award/update-com-security-award",
    {
      method: "POST",
      data
    }
  );
}

/**
 * 奖励列表-删除保安人员奖励信息
 * @author ZJH
 */
export function deleteComSecurityAwardById(data) {
  return request(
    "/enterprise/awardPenalty/per-security-award/delete-com-security-award-by-id",
    {
      method: "GET",
      data
    }
  );
}

/**********************************************处罚列表******************************************/

/**
 * 处罚列表-列表
 * @author ZJH
 */
export function listComSecurityPenalty(data) {
  return request(
    "/enterprise/awardPenalty/per-security-penalty/list-com-security-penalty",
    {
      method: "POST",
      data
    }
  );
}

/**
 * 处罚列表-新增保安处罚信息
 * @author ZJH
 */
export function addComSecurityPenalty(data) {
  return request(
    "/enterprise/awardPenalty/per-security-penalty/add-com-security-penalty",
    {
      method: "POST",
      data
    }
  );
}

/**
 * 处罚列表-修改保安处罚信息
 * @author ZJH
 */
export function updateComSecurityPpenalty(data) {
  return request(
    "/enterprise/awardPenalty/per-security-penalty/update-com-security-penalty",
    {
      method: "POST",
      data
    }
  );
}

/**
 * 处罚列表-修改保安处罚信息
 * @author ZJH
 */
export function getComSecurityPenaltyById(data) {
  return request(
    "/enterprise/awardPenalty/per-security-penalty/get-com-security-penalty-by-id",
    {
      method: "GET",
      data
    }
  );
}

/**
 * 处罚列表-删除保安处罚信息
 * @author ZJH
 */
export function deleteComSecurityPenaltyById(data) {
  return request(
    "/enterprise/awardPenalty/per-security-penalty/delete-com-security-penalty-by-id",
    {
      method: "GET",
      data
    }
  );
}

/**********************************************企业注册******************************************/

/**
 * 企业注册-验证手机是否是其他公司的主管理员注册过
 * @author Orm
 */
export function systemRoleIsCharge(data) {
  return noLoginRequest("/system/com-role/ischarge", {
    method: "GET",
    data
  });
}

/**
 * 企业注册-企业注册
 * @author Orm
 */
export function systemComBaseInfoSave(data) {
  return noLoginRequest("/system/com-base-info/save", {
    method: "POST",
    data
  });
}

/**
 * 选择部门
 * @author hjj
 */
export function getTreeDepart(data) {
  return request("/system/com-depart/get-tree-depart", {
    method: "POST",
    data
  });
}

/**
 * 选择人员
 * @author hjj
 */
export function getTreeperBydepart(data) {
  return request("/system/com-depart/get-treeper-bydepart", {
    method: "POST",
    data: data || {}
  });
}

/** 企业人员信息列表 */
export function getTreeperBydepartMap(data) {
  return request("/system/com-depart/get-treeper-bydepart-map", {
    method: "POST",
    data: data || {}
  });
}

/**********************************************劳务薪酬******************************************/
import * as api_laoWuXinChou from "./api_laoWuXinChou";

export const {
  enterpriseSalaryComReportReportInfo,
  enterpriseSalaryComReportReportDetail,
  enterpriseSalaryComReportSumActualWage,
  enterpriseSalaryComReportUpdateCompanyReport,
  enterpriseSalaryComReportReport,
  enterpriseSalaryComReportUpdateReportInfo
} = api_laoWuXinChou;
/**********************************************企业初始化******************************************/
import * as api_enterpriseInit from "./api_enterpriseInit";

export const {
  systemComInitprocessList,
  systemPerAccountInfoUpdatePassword,
  // systemComDepartList,
  systemComDepartSave,
  systemComDepartBatchInsertDepart,
  enterpriseCompanyComIndustryGetIndustryconfigByIndustrytype,
  systemComDepartDelete,
  systemComDepartImportDepart,
  systemComRoleRroupBatchInsertRoleGroup,
  systemComRoleBatchInsertRole,
  systemSysMenuAllMenuTree,
  systemComRoleAllotSave,
  systemComRoleAllotGet,
  enterpriseInsComInsUpdateProcessType,
  systemPerBaseInfoCheckAdmin,
  systemPerBaseInfoCheckPer,
  systemPerBaseInfoUpdatePassWord,
} = api_enterpriseInit;

/**********************************************任务管理******************************************/

export const {
  taskGetStepTwoDetail,
  taskGetServerTypeList,
  taskGetIndustriesList,
  taskDeleteTaskById,
  taskDeleteTask,
  taskDoneTask,
  taskCancelTask,
  taskManagementList,
  taskGetStepOneDetail,
  taskTreeTaskType,
  taskSaveStepOneDetail,
  taskSaveStepTwoDetail,
  taskSaveStepThreeDetail,
  taskGetStepThreeDetail,
  taskDeleteAddress,
  taskDeleteSchedulCycle,
  getOnlineInsBlbPreservationLink,
  taskGetTaskById
} = api_taskbuild;


/**********************************************分公司管理******************************************/

export const {
  enterpriseComManagerListBranchComManager,
  enterpriseComManagerGetComBaseInfoById,
  enterpriseComManagerListBranchRecord,
  enterpriseCompanyComBaseInfoGetBranchCom,
  enterpriseCompanyComBaseInfoGetBranch,
  enterpriseCompanyComBaseInfoGetComBaseInfoById,
  systemComBaseInfoSaveBranch
} = api_brachCompany;


/**
 * 是否需要保险提示
 * @author zjp
 */
export function enterpriseInsComInsPromptInitEnterpriseIns(data) {
  return request("/enterprise/ins/com-ins/prompt-init-enterprise-ins", {
    method: "POST",
    data: data || {}
  });
}

//获取保险保全
export function enterpriseInsComInsGetOnlineInsBlbPreservationPageLink(data) {
  return request("/enterprise/ins/com-ins/get-online-ins-blb-preservation-page-link", {
    method: "POST",
    data: data || {}
  });
}

//保存方案书
export function enterpriseInsComInsSaveBookScheme(data) {
  return request("/enterprise/ins/com-ins/save-book-scheme", {
    method: "POST",
    data: data || {}
  });
}

//获取产品列表
export function enterpriseInsComInsGetBlbProList(data) {
  return request("/enterprise/ins/com-ins/get-blb-pro-list", {
    method: "POST",
    data: data || {}
  });
}

//方案书pdf下载
export function enterpriseInsComInsGetBootSchemePdfLink(data) {
  return request("/enterprise/ins/com-ins/get-boot-scheme-pdf-link", {
    method: "POST",
    data: data || {}
  });
}

//温馨提示图片地址
export function enterpriseInsComInsPromptCompanyInitGen(data) {
  return request("/enterprise/ins/com-ins/prompt-company-init-gen", {
    method: "POST",
    data: data || {}
  });
}

